<?php
class Form_Tips extends Zend_Form
{
    public function init()
    {
        $this->setMethod('post');
        $this->setAttrib('class','frmSmall');
    	
        // create new element
        $id = $this->createElement('hidden', 'id');
        $id->setDecorators(array('ViewHelper'));
        $this->addElement($id);

        $match = $this->createElement('text', 'match');
        $match->setLabel('Trận đấu: ');
        $match->setRequired(TRUE);
        $match->setAttrib('size',256);
        $match->addFilter('StripTags'); 
        $this->addElement($match);
        
        $tip = $this->createElement('text', 'tip');
        $tip->setLabel('Bet kèo: ');
        $tip->setRequired(TRUE);
        $tip->setAttrib('size',127);
        $tip->addFilter('StripTags'); 
        $this->addElement($tip);
        
        $date = $this->createElement('text', 'date');
        $date->setLabel('Giờ đấu: ');
        $date->setRequired(TRUE);
        $date->addFilter('StripTags');
        $date->addValidator('date', 'dd-mm-YYYY');
        $this->addElement($date);
        
        $type = $this->createElement('select', 'type');
        $type->setLabel('Loại tip: ');
        $type->setRequired(TRUE); 
        $type->addMultiOptions(array(
						'1' => 'Tip thường',
						'2' => 'Tip VIP'
						));
        $this->addElement($type);
        
        $result = $this->createElement('select', 'result');
        $result->setLabel('Kết quả: ');
        $result->addMultiOptions(array(
						'' => 'Chưa đá',
						'1' => 'Thắng',
						'0' => 'Hòa',
						'-1' => 'Thua'
						));
        $this->addElement($result);
        
        
        $this->clearDecorators();
        $this->addDecorator('FormElements')
            ->addDecorator('Description', array('class' => 'frmSmall'))            
            ->addDecorator('Form');
            
        $this->setElementDecorators(array(
            array('ViewHelper'),
            array('Errors'),
            array('Description'),
            array('Label', array('separator'=>' ')),
            array('HtmlTag', array('tag' => 'p')),
        ));
        
        $submit = $this->createElement('submit','submit');
        $submit->setDecorators(array(
            array('ViewHelper'),
            array('Description'),
            array('HtmlTag', array('tag' => 'p', 'class'=>'btn')),
        ));
        $this->addElement($submit);     
    }
}
?>
